package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/*
* 客户投诉
* */
@Entity
public class Complaint {
    private int complaintId;
    private String complaintTle;
    private String comDescribe;
    private Date comTime;
    private String comType;
    private Integer degreeUrgency;
    private String comCourse;
    private Integer comResult;
    private String complaintTime;
    private String cusBack;
    private String callback;
    private String remark;
    private Integer check;

    private Emp emp;
    private Customer customer;

    @ManyToOne
    @JoinColumn(name = "emp_id")
    public Emp getEmp() {
        return emp;
    }

    public void setEmp(Emp emp) {
        this.emp = emp;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id")
    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }


    @Id
    @Column(name = "complaint_id",nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getComplaintId() {
        return complaintId;
    }

    public void setComplaintId(int complaintId) {
        this.complaintId = complaintId;
    }

    @Basic
    @Column(name = "complaint_tle",nullable = true,length = 40)
    public String getComplaintTle() {
        return complaintTle;
    }

    public void setComplaintTle(String complaintTle) {
        this.complaintTle = complaintTle;
    }

    @Basic
    @Column(name = "com_describe",nullable = true,length = 200)
    public String getComDescribe() {
        return comDescribe;
    }

    public void setComDescribe(String comDescribe) {
        this.comDescribe = comDescribe;
    }

    @Basic
    @Column(name = "com_time",nullable = true)
    public Date getComTime() {
        return comTime;
    }

    public void setComTime(Date comTime) {
        this.comTime = comTime;
    }

    @Basic
    @Column(name = "com_type",nullable = true,length = 200)
    public String getComType() {
        return comType;
    }

    public void setComType(String comType) {
        this.comType = comType;
    }

    @Basic
    @Column(name = "degree_urgency",nullable = true)
    public Integer getDegreeUrgency() {
        return degreeUrgency;
    }

    public void setDegreeUrgency(Integer degreeUrgency) {
        this.degreeUrgency = degreeUrgency;
    }

    @Basic
    @Column(name = "com_course",nullable = true,length = 200)
    public String getComCourse() {
        return comCourse;
    }

    public void setComCourse(String comCourse) {
        this.comCourse = comCourse;
    }

    @Basic
    @Column(name = "com_result",nullable = true)
    public Integer getComResult() {
        return comResult;
    }

    public void setComResult(Integer comResult) {
        this.comResult = comResult;
    }

    @Basic
    @Column(name = "complaint_time",nullable = true,length = 40)
    public String getComplaintTime() {
        return complaintTime;
    }

    public void setComplaintTime(String complaintTime) {
        this.complaintTime = complaintTime;
    }

    @Basic
    @Column(name = "cus_back",nullable = true,length = 100)
    public String getCusBack() {
        return cusBack;
    }

    public void setCusBack(String cusBack) {
        this.cusBack = cusBack;
    }

    @Basic
    @Column(name = "callback",nullable = true,length = 100)
    public String getCallback() {
        return callback;
    }

    public void setCallback(String callback) {
        this.callback = callback;
    }

    @Basic
    @Column(name = "remark",nullable = true,length = 200)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "check_state",nullable = true,length = 200)
    public Integer getCheck() {
        return check;
    }

    public void setCheck(Integer check) {
        this.check = check;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Complaint complaint = (Complaint) o;
        return complaintId == complaint.complaintId &&
                Objects.equals(complaintTle, complaint.complaintTle) &&
                Objects.equals(comDescribe, complaint.comDescribe) &&
                Objects.equals(comTime, complaint.comTime) &&
                Objects.equals(comType, complaint.comType) &&
                Objects.equals(degreeUrgency, complaint.degreeUrgency) &&
                Objects.equals(comCourse, complaint.comCourse) &&
                Objects.equals(comResult, complaint.comResult) &&
                Objects.equals(complaintTime, complaint.complaintTime) &&
                Objects.equals(cusBack, complaint.cusBack) &&
                Objects.equals(callback, complaint.callback) &&
                Objects.equals(remark, complaint.remark) &&
                Objects.equals(check, complaint.check);
    }

    @Override
    public int hashCode() {
        return Objects.hash(complaintId, complaintTle, comDescribe, comTime, comType, degreeUrgency, comCourse, comResult, complaintTime, cusBack, callback, remark, check);
    }
}
